package com.soulkun.smarthome.ui.splash

import android.app.Activity
import android.content.Intent
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import com.soulkun.smarthome.R
import com.soulkun.smarthome.databinding.AppActivitySplashBinding
import soulkun.library.mvvm.component.BaseDataBindingActivity
import soulkun.library.utils.screen.ScreenUtils

class AppSplashActivity : BaseDataBindingActivity<AppActivitySplashBinding>() {

    companion object{

        fun startIntentAnimationDefault(activity: Activity) {
            val intent = Intent(activity, AppSplashActivity::class.java)
            activity.startActivity(intent)
        }

        fun startIntentAnimationSlideVertical(activity: Activity) {
            val intent = Intent(activity, AppSplashActivity::class.java)
            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
            activity.startActivity(intent)
            activity.overridePendingTransition(R.anim.fade_in, R.anim.slide_out_left)
        }

    }

    override fun setLayout(): Int {
        return R.layout.app_activity_splash
    }

    override fun initIntent(savedInstanceState: Bundle?) {
    }

    override fun initView() {
        ScreenUtils.setBlackStatusText(this)
        window.decorView.background = ColorDrawable(resources.getColor(R.color.app_white_FF))
    }

    override fun initData() {
    }

    override fun initListener() {
    }

}